package org.springblade.common.constant;

/**
 * @File: SecurityConstants.java
 * @Project: csjbot-service
 * @Package: org.springblade.auth.constants
 * @Description:
 * @Company: 苏州穿山甲机器人股份有限公司
 * @author: zhouhong
 * @date: 2019年11月21 11时23分
 * @version: V1.0.0
 */
public interface SecurityConstants {
	/**
	 * 角色前缀
	 */
	String ROLE = "ROLE_";
	/**
	 * 前缀
	 */
	String PROJECT_PREFIX = "pig_";

	/**
	 * oauth 相关前缀
	 */
	String OAUTH_PREFIX = "oauth:";
	/**
	 * 项目的license
	 */
	String PROJECT_LICENSE = "made by csj";

	/**
	 * 内部
	 */
	String FROM_IN = "Y";

	/**
	 * 标志
	 */
	String FROM = "from";

	/**
	 * 手机号登录URL
	 */
	String MOBILE_TOKEN_URL = "/mobile/token";

	/**
	 * 默认登录URL
	 */
	String OAUTH_TOKEN_URL = "/oauth/token";

	/**
	 * grant_type
	 */
	String REFRESH_TOKEN = "refresh_token";

	/**
	 * grant_type
	 */
	String PASSWORD = "password";

	/**
	 * oauth 客户端信息
	 */
	String CLIENT_DETAILS_KEY = PROJECT_PREFIX + OAUTH_PREFIX + "client:details";

	/**
	 * {bcrypt} 加密的特征码
	 */
	String BCRYPT = "{bcrypt}";
	/**
	 * blade_client 表的字段，不包括client_id、client_secret
	 */
	String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
		+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
		+ "refresh_token_validity, additional_information, autoapprove";

	/**
	 * JdbcClientDetailsService 查询语句
	 */
	String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS
		+ " from blade_client";

	/**
	 * 默认的查询语句
	 */
	String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";

	/**
	 * 按条件client_id 查询
	 */
	String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

	/***
	 * 资源服务器默认bean名称
	 */
	String RESOURCE_SERVER_CONFIGURER = "resourceServerConfigurerAdapter";

	/**
	 * 用户ID字段
	 */
	String DETAILS_USER_ID = "user_id";
	/**
	 * 角色ID
	 */
	String DETAILS_RPLE_ID = "role_id";

	/**
	 * 用户账号
	 */
	String DETAILS_USER_ACCOUNT = "account";


	/**
	 * 用户账号
	 */
	String DETAILS_USER_NAME = "user_name";

	/**
	 * 用户头像
	 */
	String DETAILS_USER_AVATAR = "avatar";

	/**
	 * 用户昵称
	 */
	String DETAILS_USER_NICK_NAME = "nick_name";

	/**
	 * 用户角色
	 */
	String DETAILS_USER_ROLE_NAME = "role_name";
	/**
	 * 租户ID
	 */
	String DETAILS_USER_TENANT_ID = "tenant_id";

	/**
	 * 用户名字段
	 */
	String DETAILS_USERNAME = "username";

	/**
	 * 用户部门字段
	 */
	String DETAILS_DEPT_ID = "dept_id";

	/**
	 * 协议字段
	 */
	String DETAILS_LICENSE = "license";


}
